package com.zrsx.searchmodel.controller;

import com.zrsx.searchmodel.common.result.Result;
import com.zrsx.searchmodel.common.vo.UserVO;
import com.zrsx.searchmodel.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/credit/user")
@Slf4j
@Tag(name = "基础信息")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/{userId}")
    @Operation(summary = "获取用户基础信息")
    public Result<UserVO> getUserInfo(@PathVariable Integer userId){
        return Result.success(userService.getUserInfo(userId));
    }

}
